<template>
	<view>
		<uv-picker ref="picker" :columns="columns" @confirm="confirm" keyName="label"></uv-picker>
	</view>
</template>
<script>
	import {
		toRaw
	} from 'vue';
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
			}
		},
		computed: {
			columns() {
				return [this.list];
			}
		},
		mounted() {
			console.log('columns:', this.columns);
			console.log('list:', this.list);
		},
		methods: {
			openPicker() {
				this.$refs.picker.open();
			},
			confirm(e) {
				console.log('e:', e);
				this.$emit('update:modelValue', e.value[0].label);
			}
		}
	}
</script>